package com.maybach.core.ao.impl;

import com.audi.dubbo.api.brand.vos.BrandVo;
import com.audi.dubbo.api.brand.vos.ModelVo;
import com.audi.dubbo.api.brand.vos.SeriesVo;
import com.audi.dubbo.api.common.Result;
import com.maybach.core.ao.BrandAndSeriesAO;
import com.maybach.core.dubbo.consumer.adapter.BrandServiceDubboAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by songshuang on 16/3/2.
 */
@Component
public class BrandAndSeriesAOImpl implements BrandAndSeriesAO {

    @Autowired
    private BrandServiceDubboAdapter brandServiceDubboAdapter;

    @Override
    public Result<List<BrandVo>> getAllBrand() {
        return brandServiceDubboAdapter.getAllBrand();
    }

    @Override
    public Result<List<SeriesVo>> getSeriesByBrandId(Long brandId) {
        return brandServiceDubboAdapter.getSeriesByBrandId(brandId);
    }

    @Override
    public Result<List<ModelVo>> getModelsBySeriesId(Long seriesId) {
        return brandServiceDubboAdapter.getModelsBySeriesId(seriesId);
    }

    @Override
    public Result<List<BrandVo>> getBrandListByIds(List<Long> ids) {
        return brandServiceDubboAdapter.getBrandListByIds(ids);
    }


}
